package com.jamie.api.order;

import com.jamie.api.dto.OrderDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Jamie
 * @date 2020/4/13
 */
@FeignClient("order")
@RequestMapping("order")
public interface OrderService {

    /**
     * 创建订单
     *
     * @param userId        用户id
     * @param commodityCode 商品编码
     * @param orderCount    购买数量
     * @return 订单
     */
    @PostMapping
    OrderDTO create(@RequestParam("userId") String userId,
                    @RequestParam("commodityCode") String commodityCode,
                    @RequestParam("orderCount") int orderCount);
}
